package com.hyt.it.ogt.ykcj.common.enums;

/**
 * description
 *
 * @author yaojian
 * @createTime 2021/12/03
 */
public enum ExchangeValTypeEnum {

    //考试系统中学生值type字段对应得类型，1：能直接显示的文本，2：显示的图片，3：其他没办法直接给前端显示的内容，如附件，多行文本等
    EXCHANGE_User_VAL_TYPE_1("input", "1"),
    EXCHANGE_User_VAL_TYPE_2("select", "1"),
    EXCHANGE_User_VAL_TYPE_3("address", "1"),
    EXCHANGE_User_VAL_TYPE_11("date", "1"),
    EXCHANGE_User_VAL_TYPE_12("radio", "1"),
    EXCHANGE_User_VAL_TYPE_13("number", "1"),
    EXCHANGE_User_VAL_TYPE_4("cloudFile", "2"),
    EXCHANGE_User_VAL_TYPE_5("enclosure", "3"),
    EXCHANGE_User_VAL_TYPE_6("cardtype", "1"),
    EXCHANGE_User_VAL_TYPE_7("select", "3"),
    EXCHANGE_User_VAL_TYPE_31("cascader", "3"),
    EXCHANGE_User_VAL_TYPE_32("textarea", "3"),

    ;

    private String name;
    private String filedName;

    ExchangeValTypeEnum(String name, String filedName) {
        this.name = name;
        this.filedName = filedName;
    }

    public static String getValue(String key) {
        ExchangeValTypeEnum[] exchangeNameEnums = values();
        for (ExchangeValTypeEnum exchangeNameEnum : exchangeNameEnums) {
            if (exchangeNameEnum.getKeyName().equals(key)) {
                return exchangeNameEnum.getValName();
            }
        }
        //没有找到得类型都为其他
        return "3";
    }


    public String getKeyName() {
        return name;
    }

    public void setKeyName(String name) {
        this.name = name;
    }

    public String getValName() {
        return filedName;
    }

    public void setValName(String filedName) {
        this.filedName = filedName;
    }
}
